package com.leyou.item.mapper;

import com.leyou.common.base.BaseMapper;
import com.leyou.item.pojo.Category;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CategoryMapper extends BaseMapper<Category> {
    @Select("SELECT tc.id, tc.`name`, tc.parent_id, tc.is_parent," +
            " tc.sort FROM tb_category_brand tcb LEFT JOIN tb_category tc ON tcb.category_id = tc.id WHERE tcb.brand_id = #{id}")
    List<Category> queryByBrandId(@Param("id") Long brandId);
}
